package com.zhiyou100.action01;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author yang
 * @className Demo01
 * @packageName com.zhiyou100.action01
 * @Description TODO 实现 Controller
 * @date 2020-08-21 09:41
 */
public class Demo01 implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        request.setCharacterEncoding("utf-8");

        System.out.println("d1 的请求参数" + request.getParameter("sage") + " " + request.getParameter("sname"));

        final ModelAndView mv = new ModelAndView();

        mv.addObject("message", "d1 成功1！");

        mv.setViewName("/test01/success.jsp");

        return mv;
    }
}
